#替换
#replace(旧，新，替换次数)
str="hello and world and itcast and lan"

#newstr=str.replace('and','zhong',1)
# rnewst=str.replace('and','zhong',2)
# rnewst=str.replace('and','zhong',3)

#分割
#split(分割字符，num分割字符出现字数)   分割成num+1份-去掉分割字符
#返回列表
#str.split('and',2)
# ['hello ', ' world ', ' itcast and lan']

newstr=str.split('and',3)
# #['hello ', ' world ', ' itcast ', ' lan']

#join合并字串
#'合并连接的字串'.join(需要合并含字符序列)
list=['a','b','c']
#print(','.join(list))
# a,b,c
# print('-'.join(list))
# a-b-c
print(newstr)
